<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <!-- v-clock解决闪烁问题 -->
    <style>
        [v-clock]{
            display: none;
        }
    </style>
</head>
<body>

<div id="vue" v-clock>
    <div>
        {{info.name}}
    </div>
    <div>
        {{info.address}}
    </div>

    <a v-bind:href="info.url">Click Me </a>

    <li v-for="item in info.links">{{item}}</li>
</div>


<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: "#vue",
        // data 属性
        // data() 方法
        data() {
            return {
                //  请求的返回参数合适， 必须和json字符串一样
                info: {
                    name: null,
                    address: {
                        street: null,
                        city: null,
                        country: null
                    },
                    url: null,
                    links: []
                }
            }
        },
        mounted() { // 钩子函数 链式编程 ES6新特性
            axios.get('../data.json').then(response=>(this.info=response.data));
        }
    });
</script>

</body>
</html>